// 卡券公共样式

.bui-coupon {
  &-list {
    background-color: #f5f5f5;
    .coupon-item {
      margin-left: 28rpx;
      position: relative;
      width: 690rpx;
      height: 266rpx;
      padding: 40rpx 40rpx 40rpx 40rpx;
      background-repeat: no-repeat;
      background-size: cover;
      background-color: #f6f6f6;
      box-sizing: border-box;
      overflow: hidden;
      margin-bottom: 28rpx;

      .list__bg {
        position: absolute;
        left: 0;
        top: 0;
        width: 101%;
        height: 104%;
      }

      @mixin badge($type, $color) {
        &.bui-coupon-type-#{$type} {
          .bui-coupon-hd .badge {
            background: $color;
          }
        }
      }
      @include badge(exchange, #333);
      @include badge(discount, rgba(215, 186, 122, 0.67));
      @include badge(cash, #e18484);

      @mixin bg($status) {
        &.bui-coupon-status-#{$status} {
          -webkit-filter: grayscale(100%);

          .badge {
            background: #f1f1f1 !important;
            color: #fff !important;
          }
          .type {
            color: #b2b2b2 !important;
          }
          .limit {
            color: #c8c8c8;
          }
          .heading {
            color: #c8c8c8 !important;
          }
          .bui-coupon-bottom p {
            color: #c8c8c8;
          }
        }
      }

      @include bg(unpublish);
      @include bg(used);
      @include bg(invalid);
      @include bg(finish);
    }
  }

  &-hd {
    display: flex;
    padding-bottom: 50rpx;
    border-bottom: 2rpx dashed #f3f4f5;
    .badge {
      position: relative;
      display: block;
      width: 92rpx;
      height: 92rpx;
      color: white;
      font-size: 60rpx;
      text-align: center;
      line-height: 88rpx;
      border-radius: 100%;
    }
    .text {
      display: flex;
      flex: 1;
      flex-direction: column;
      margin-left: 28rpx;
      z-index: 1;
      .type {
        font-weight: bold;
        font-size: 44rpx;
        line-height: 60rpx;
        color: #333;
        text-align: left;
        > view {
          display: inline-block;
        }
        .prefix,
        .suffix {
          font-size: 24rpx;
          font-weight: bold;
        }
        .prefix {
          margin-right: 8rpx;
        }
        .suffix {
          margin-left: 8rpx;
        }
        .limit {
          font-weight: 400;
          margin-left: 8rpx;
          font-size: 26rpx;
          color: #999;
        }
      }
      .heading {
        width: 300rpx;
        margin-top: 10rpx;
        font-size: 24rpx;
        line-height: 24rpx;
        color: #333;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }
    .use {
      font-size: 24rpx;
      width: 160rpx;
      text-align: center;
      position: absolute;
      height: 60rpx;
      line-height: 60rpx;
      border-radius: 60rpx;
      color: #aa8441;
      border: 1px solid #aa8441;
      top: 100rpx;
      right: 40rpx;
      z-index: 2;
      background-color: #fff;
    }
  }
  &-bottom {
    position: relative;
    display: flex;
    padding: 22rpx 0;
    lable {
      color: #999;
      font-size: 24rpx;
      line-height: 24rpx;
      &:last-child {
        flex: 1;
        text-align: right;
      }
    }
  }
  &-status {
    position: absolute;
    display: block;
    width: 180rpx;
    height: 160rpx;
    right: -40rpx;
    bottom: -24rpx;

    > image {
      width: 100%;
      height: 100%;
    }
  }
}
